#include "mainwindow.h"
#include "dorgen.h"

#include <QDebug>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
    QSettings settings(QDir::currentPath() + QDir::separator() + "temp.ini", QSettings::IniFormat);
    settings.setValue("Main/WriteInExists", true);
    settings.setValue("Main/PagesNumber", 10);
    settings.setValue("Keys/File", "./keys.txt");
    settings.setValue("Keys/Count", 0);
    settings.setValue("Keys/Shuffle", true);
    settings.setValue("Text/Files", QStringList("text.txt"));
    settings.setValue("Template/Directory", "template");
    settings.setValue("Template/CopyAll", true);

    Dorgen* dorgen = new Dorgen();

    connect(dorgen, SIGNAL(unsetted(QString)), this, SLOT(debug2Print(QString)));
    connect(dorgen, SIGNAL(failedOpen(QString)), this, SLOT(debug2Print(QString)));

    dorgen->setSettings(QDir::currentPath() + QDir::separator() + "temp.ini");



}

void MainWindow::debug2Print(QString ms)
{
    qDebug() << ms;
}

MainWindow::~MainWindow()
{

}
